/* Reset and base styles */
:root {
  font-family: system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  font-weight: 400;
  color-scheme: light dark;
  color: rgba(255, 255, 255, 0.87);
  background-color: #242424;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

/* Layout */
.sidebar {
  width: 280px;
  background-color: #1e1e1e;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  border-right: 1px solid #333;
}

.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.canvas-container {
    flex-grow: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #2d2d2d;
    overflow: auto; /* Add scroll for large images */
}

canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}


/* Controls */
.controls {
  margin-bottom: 1rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: #a0a0a0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button, .file-input-label {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: center;
}

button:hover, .file-input-label:hover {
  background-color: #4338ca;
}

button:disabled {
    background-color: #555;
    cursor: not-allowed;
}

input[type="file"] {
  display: none;
}

/* Image List */
.image-list {
  list-style: none;
  padding: 0;
  margin: 0;
  flex-grow: 1;
  overflow-y: auto;
}

.image-list-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.2s;
  border: 2px solid transparent;
}

.image-list-item:hover {
  background-color: #333;
}

.image-list-item.active {
  background-color: #4f46e5;
  border-color: #818cf8;
}

.image-list-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  margin-right: 1rem;
  border-radius: 4px;
}

.image-list-item span {
  color: #e0e0e0;
  font-weight: 500;
}